/*
 * XML Type:  XAction
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XAction
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XAction(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XActionImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.widget.XAction
{
    private static final long serialVersionUID = 1L;
    
    public XActionImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TYPE$0 = 
        new javax.xml.namespace.QName("", "type");
    private static final javax.xml.namespace.QName FACTORY$2 = 
        new javax.xml.namespace.QName("", "factory");
    private static final javax.xml.namespace.QName INITPARA$4 = 
        new javax.xml.namespace.QName("", "initPara");
    private static final javax.xml.namespace.QName RESULT$6 = 
        new javax.xml.namespace.QName("", "result");
    private static final javax.xml.namespace.QName EXCUTEMETHOD$8 = 
        new javax.xml.namespace.QName("", "excuteMethod");
    
    
    /**
     * Gets the "type" element
     */
    public java.lang.String getType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "type" element
     */
    public org.apache.xmlbeans.XmlString xgetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "type" element
     */
    public boolean isSetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TYPE$0) != 0;
        }
    }
    
    /**
     * Sets the "type" element
     */
    public void setType(java.lang.String type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TYPE$0);
            }
            target.setStringValue(type);
        }
    }
    
    /**
     * Sets (as xml) the "type" element
     */
    public void xsetType(org.apache.xmlbeans.XmlString type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TYPE$0);
            }
            target.set(type);
        }
    }
    
    /**
     * Unsets the "type" element
     */
    public void unsetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TYPE$0, 0);
        }
    }
    
    /**
     * Gets the "factory" element
     */
    public java.lang.String getFactory()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FACTORY$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "factory" element
     */
    public org.apache.xmlbeans.XmlString xgetFactory()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(FACTORY$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "factory" element
     */
    public boolean isSetFactory()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(FACTORY$2) != 0;
        }
    }
    
    /**
     * Sets the "factory" element
     */
    public void setFactory(java.lang.String factory)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FACTORY$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(FACTORY$2);
            }
            target.setStringValue(factory);
        }
    }
    
    /**
     * Sets (as xml) the "factory" element
     */
    public void xsetFactory(org.apache.xmlbeans.XmlString factory)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(FACTORY$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(FACTORY$2);
            }
            target.set(factory);
        }
    }
    
    /**
     * Unsets the "factory" element
     */
    public void unsetFactory()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(FACTORY$2, 0);
        }
    }
    
    /**
     * Gets array of all "initPara" elements
     */
    public com.seedwill.xul.core.XPara[] getInitParaArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(INITPARA$4, targetList);
            com.seedwill.xul.core.XPara[] result = new com.seedwill.xul.core.XPara[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "initPara" element
     */
    public com.seedwill.xul.core.XPara getInitParaArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(INITPARA$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "initPara" element
     */
    public int sizeOfInitParaArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(INITPARA$4);
        }
    }
    
    /**
     * Sets array of all "initPara" element
     */
    public void setInitParaArray(com.seedwill.xul.core.XPara[] initParaArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(initParaArray, INITPARA$4);
        }
    }
    
    /**
     * Sets ith "initPara" element
     */
    public void setInitParaArray(int i, com.seedwill.xul.core.XPara initPara)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(INITPARA$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(initPara);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "initPara" element
     */
    public com.seedwill.xul.core.XPara insertNewInitPara(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().insert_element_user(INITPARA$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "initPara" element
     */
    public com.seedwill.xul.core.XPara addNewInitPara()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().add_element_user(INITPARA$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "initPara" element
     */
    public void removeInitPara(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(INITPARA$4, i);
        }
    }
    
    /**
     * Gets array of all "result" elements
     */
    public com.seedwill.xul.core.XPara[] getResultArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(RESULT$6, targetList);
            com.seedwill.xul.core.XPara[] result = new com.seedwill.xul.core.XPara[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "result" element
     */
    public com.seedwill.xul.core.XPara getResultArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(RESULT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "result" element
     */
    public int sizeOfResultArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(RESULT$6);
        }
    }
    
    /**
     * Sets array of all "result" element
     */
    public void setResultArray(com.seedwill.xul.core.XPara[] resultArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(resultArray, RESULT$6);
        }
    }
    
    /**
     * Sets ith "result" element
     */
    public void setResultArray(int i, com.seedwill.xul.core.XPara result)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().find_element_user(RESULT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(result);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "result" element
     */
    public com.seedwill.xul.core.XPara insertNewResult(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().insert_element_user(RESULT$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "result" element
     */
    public com.seedwill.xul.core.XPara addNewResult()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPara target = null;
            target = (com.seedwill.xul.core.XPara)get_store().add_element_user(RESULT$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "result" element
     */
    public void removeResult(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(RESULT$6, i);
        }
    }
    
    /**
     * Gets the "excuteMethod" element
     */
    public java.lang.String getExcuteMethod()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXCUTEMETHOD$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "excuteMethod" element
     */
    public org.apache.xmlbeans.XmlString xgetExcuteMethod()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(EXCUTEMETHOD$8, 0);
            return target;
        }
    }
    
    /**
     * Sets the "excuteMethod" element
     */
    public void setExcuteMethod(java.lang.String excuteMethod)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXCUTEMETHOD$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(EXCUTEMETHOD$8);
            }
            target.setStringValue(excuteMethod);
        }
    }
    
    /**
     * Sets (as xml) the "excuteMethod" element
     */
    public void xsetExcuteMethod(org.apache.xmlbeans.XmlString excuteMethod)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(EXCUTEMETHOD$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(EXCUTEMETHOD$8);
            }
            target.set(excuteMethod);
        }
    }
}
